﻿@model Blog.Models.Resource
<form class="layui-form " id="resourceForm" style="text-align:left">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="Name" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">摘要</label>
        <div class="layui-input-block">
            <input type="text" name="Abstract" lay-verify="required" placeholder="请输入摘要" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">演示地址</label>
        <div class="layui-input-block">
            <input type="text" name="Demolink" placeholder="请输入演示地址（选填）" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">下载地址</label>
        <div class="layui-input-block">
            <input type="text" name="Downloadlink" placeholder="请输入下载地址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-block">
            @Html.DropDownListFor(model => model.Type, Html.GetEnumSelectList(typeof(Blog.Models.Enum.ResourceType)))
        </div>
    </div>
    <div class="layui-form-item" style="position:relative;">
        <label class="layui-form-label">封面</label>
        <div class="layui-input-inline">
            <input name="ResourceCoverSrc" type="hidden" id="ResourceCoverSrc" />
            <img id="resourceCoverImg" style="width:100%;height:auto;border:1px solid #ddd" class="img-cover" src="~/Images/cover_default.jpg" alt="封面" />
        </div>
        <div class="layui-input-inline" style="position:absolute;bottom:0;">
            <button type="button" id="upImg" class="layui-btn layui-btn-primary layui-btn-small">
                <i class="layui-icon ">&#xe654;上传封面</i>
            </button>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" lay-submit lay-filter="*">立即提交</button>
            <button type="button" id="listBack" lay-filter="listBack" class="layui-btn layui-btn-primary">返回列表</button>
        </div>
    </div>
</form>

<script src="~/js/admin/resource/add.js"></script>